package com.atguigu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j         //手动刷新功能
@RefreshScope  //此注解RefreshScope解决每次运维修改配置文件比如gitee上配置信息，客户端3355等频繁重启问题
public class ConfigClientController {
    //注意：此处config.info是https://gitee.com/jike11231/springcloud-config的config-dev.yml中的info内容
    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo(){
        return configInfo;
    }

    //运维人员修改完gitee配置信息后，手动发送post请求（必须是post），使得3355客户端不用重启获取到最新配置
    //curl -X POST "http://lcoalhost:3355/actuator/refresh"
}
